package com.lzx.answer.controller.web;

import com.lzx.answer.entity.ReplyGiveALike;
import com.lzx.answer.service.ReplyGiveALikeService;
import com.lzx.common.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/answer/replyGiveALike/web")
public class WebReplyGiveALikeController {
    @Resource
    private ReplyGiveALikeService replyGiveALikeService;

    //根据问题id和用户id查询用户点赞信息
    @GetMapping("/selectReplyGiveALive/{problemId}/{userId}")
    public R selectReplyGiveALive(@PathVariable Long problemId, @PathVariable Long userId) {
        return replyGiveALikeService.selectReplyGiveALive(problemId, userId);
    }

    //问题回复点赞
    @PostMapping("/likeReply")
    public R likeReply(@RequestBody ReplyGiveALike replyGiveALike) {
        return replyGiveALikeService.likeReply(replyGiveALike);
    }
}
